package com.example.workrecord.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
  *@ClassName: AuthInfo
  *@Description 应用配置信息
  *@Author Mr.Bu
  *@Date 2020/3/4 9:58
  *@Version: 1.0
  */
@Entity
@Data
@Table(name="auth_info")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModel(description = "应用配置信息")
@EntityListeners(AuditingEntityListener.class)
public class AuthInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue()
    @ApiModelProperty(value = "主键")
    private Long id;
    @ApiModelProperty(value = "钉钉组织id")
    private String  corpId;
    private String corpName;
    private String accessToken;
    private Long expires;
    @ApiModelProperty(value = "钉钉应用key")
    private String appKey;
    private String appSecret;
    private String agentId;
    @Transient
    @ApiModelProperty(value = "钉钉授权码")
    private String code;

    @Transient
    @ApiModelProperty(value = "应用可见性")
    private String pub;

    /**
     * 创建时间
     */
    @CreatedDate
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 修改时间
     */
    @LastModifiedDate
    @Column(name = "modify_time")
    private Date modifyTime;


}
